package net.url;

import java.net.URL;
import java.net.URLConnection;
import java.util.Date;

public class HeaderViewer
{
	public static void main(String[] args)
	{
		try
		{
			URL u = new URL("http://www.baidu.com");
			URLConnection uc = u.openConnection();
			System.out.println(uc.getContentType());
			System.out.println(uc.getContentEncoding());
			System.out.println(new Date(uc.getDate()));
			System.out.println(uc.getLastModified());
			System.out.println(new Date(uc.getExpiration()));
			System.out.println(uc.getContentLength());
		}
		catch (Exception e)
		{
		}
	}
}
